<template>
  <div>
    <TbTitle title="四、接受监督检查情况" />
    <table border="0">
      <tr>
        <td rowspan="3">年度检查</td>
        <td>检查年度</td>
        <td>年检结论</td>
        <td colspan="2">整改情况</td>
      </tr>
      <tr v-for="innerItem in detailInfo.checkList">
        <td>{{ innerItem.inspectYear }}</td>
        <td>{{ dictToVal(dict1, innerItem.rectificationConclusion) }}</td>
        <td colspan="2">{{ dictToVal(dict3, innerItem.rectificationSituation) }}</td>
      </tr>
      <tr>
        <td rowspan="2">社会组织评估</td>
        <td>是否参评</td>
        <td style="width: 150px">{{ yesNoBool(detailInfo.socialOrganizationEvaluation) }}</td>
        <td>评估结果</td>
        <td style="width: 150px">{{ dictToVal(dict4, detailInfo.socialOrganizationEvaluationResult) }}</td>
      </tr>
      <tr>
        <td>有效期至</td>
        <td colspan="3">{{ detailInfo.socialOrganizationEvaluationValidityPeriod }}</td>
      </tr>
      <tr>
        <td>获得税收优惠资格情况</td>
        <td>公益性捐赠税前扣除资格</td>
        <td>{{ detailInfo.eligibilityTaxIncentivesTimeState == 1?'是':'否'}}
        </td>
        <td>非营利组织免税资格</td>
        <td>{{ detailInfo.organizationalExemptionEligibilityTimeState?'是':'否' }}
        </td>
      </tr>
      <tr>
        <td>时间</td>
        <td>公益性捐赠税前扣除资格日期</td>
        <td>{{ detailInfo.eligibilityTaxIncentivesTime}}
        </td>
        <td>非营利组织免税资格日期</td>
        <td>{{ detailInfo.organizationalExemptionEligibilityTime}}
        </td>
      </tr>
      <tr>
        <td rowspan="5">行政处罚</td>
        <td colspan="2">是否受到过行政处罚</td>
        <td colspan="2">
          {{ yesNoBool(detailInfo.administrativePenalty) }}
          （如选否，则不需填写以下四项内容）
        </td>
      </tr>
      <tr>
        <td colspan="2">行政处罚时间</td>
        <td colspan="2">{{ detailInfo.administrativePenaltyTime }}</td>
      </tr>
      <tr>
        <td colspan="2">行政处罚种类</td>
        <td colspan="2">{{ dictToVal(dict2, detailInfo.administrativePenaltyType) }}</td>
      </tr>
      <tr>
        <td colspan="2">行政处罚实施机关</td>
        <td colspan="2">{{ detailInfo.administrativePenaltyOffice }}</td>
      </tr>
      <tr>
        <td colspan="2">违法行为</td>
        <td colspan="2">{{ detailInfo.illegalBehavior }}</td>
      </tr>
      <tr>
        <td rowspan="2">信用信息管理情况</td>
        <td>是否被列入活动异常名录</td>
        <td>{{ detailInfo.activityXceptionIrectory == 1?'是':'否' }}</td>
        <td>是否被列入严重违法失信名单</td>
        <td>{{detailInfo.seriousIllegalBehavior == 1?'是':'否' }}</td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
import { ref, reactive, inject, getCurrentInstance } from 'vue'
import { getDictAnnual, getDictAdministrativePenalty, getDictsituation } from '@/api/dict/index'
import { getDictByCode } from '@/views/yearCheck/ykb/st/st'
let detailInfo = reactive({})
const { getDetailInfo } = inject('getDetailInfo')

const { proxy } = getCurrentInstance();
const yesNoBool = proxy.$yesNoBool

const dict1 = ref([])
const dict2 = ref([])
const dict3 = ref([])
const dict4 = ref([])
getDetailInfo().then(res => {
  Object.assign(detailInfo, res.data)
})
let getDictInfo = () => {
  //年检结论
  getDictAnnual().then(res => {
    dict1.value = res.data
  })
  getDictByCode('level').then(response => {
    dict4.value = response.data
  })
  //行政处罚种类
  getDictAdministrativePenalty().then(res => {
    dict2.value = res.data
  })
  //整改情况
  getDictsituation().then(res => {
    dict3.value = res.data
  })
}
getDictInfo()

const dictToVal = (dictList, val) => {
  for (let i = 0; i < dictList.length; i++) {
    if (val == dictList[i].id) {
      return dictList[i].name
    }
  }
}

</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;

  font-family: '微软雅黑';
}

table {
  border-spacing: 0px;
  width: 100%;
  border-top: 1px solid #999;
  border-left: 1px solid #999;
  color: #000;

  thead {
    background: #f5f7fa;
    color: rgb(37, 43, 53);

    th {
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      text-align: center;
      height: 40px;
    }
  }

  td {
    height: 40px;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    text-align: center;

    &.td-head {
      background: #f5f7fa;
    }
  }

}
</style>
